/**
 * 封装get请求方法
 * @description xhj
 */
import axios from 'axios'

// const urlMap = {
//   development: '/',
//   production: 'http://xiehongjin.com/seller'
// }

// const baseUrl = urlMap[process.env.NODE_ENV]

const ERR_OK = 0
export function get (url) {
  // baseUrl+url
  return function (params) {
    return axios
      .get(url, {
        params
      })
      .then(res => {
        const {
          errno,
          data
        } = res.data
        if (errno === ERR_OK) {
          return data
        }
      })
      .catch(() => {})
  }
}
